﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace GMapNET
{
   public class Route
   {
      public List<PointLatLng> Points=new List<PointLatLng>();
      public string Name;
      public Color Color;
      public bool AddFenceToRoute = true;
      public int bufferDistance = 0;

      public PointLatLng ?From
      {
         get
         {
            if(Points.Count > 0)
            {
               return Points[0];
            }

            return null;
         }
      }

      public PointLatLng? To
      {
         get
         {
            if(Points.Count > 0)
            {
               return Points[Points.Count-1];
            }

            return null;
         }
      }

      public void AddRoutePoint(PointLatLng ll)
      {
          Points.Add(ll);
      }

      public Route(string name, Color routeColor)
      {
          Name = name;

          Color = routeColor;
      }

      public Route(List<PointLatLng> points, string name, Color routeColor)
      {
         Points = points;
         Points.TrimExcess();

         Name = name;

         Color = routeColor;        
      }
   }
}
